import requests
from runner_运行程序 import ENV


def login_merchant():
    """
    登录crmeb商户端
    :return:
    """
    url=f'{ENV.host_merchant}/api/admin/merchant/login'
    json_data = {
        'account': ENV.username_merchant,
        'pwd': ENV.password_merchant,
        'captchaVO': {},
        'captcha': {
            'captchaVerification': '',
            'secretKey': '',
            'token': '',
        },
    }
    response = requests.post(url, headers={'content-type': 'application/json'},json=json_data)
    return response.json()


if __name__ == '__main__':
    token_merchant = login_merchant()['data']['token']
    print(token_merchant)
